#include <ros/ros.h>
#include <visualization_msgs/Marker.h>

int main(int argc, char** argv) {
  ros::init(argc, argv, "marker_3d_box");
  ros::NodeHandle nh;
  ros::Publisher marker_pub = nh.advertise<visualization_msgs::Marker>("visualization_marker", 10);

  // Set the frame ID and timestamp
  visualization_msgs::Marker marker;
  marker.header.frame_id = "livox";
  marker.header.stamp = ros::Time::now();

  // Set the namespace and ID for this marker
  marker.ns = "marker_3d_box";
  marker.id = 0;

  // Set the marker type to be a cube
  marker.type = visualization_msgs::Marker::CUBE;

  // Set the position and orientation of the marker
  marker.pose.position.x = 0.0;
  marker.pose.position.y = 0.0;
  marker.pose.position.z = 0.646;
  marker.pose.orientation.x = 0.0;
  marker.pose.orientation.y = 0.0;
  marker.pose.orientation.z = 0.0;
  marker.pose.orientation.w = 0.0;

  // Set the scale of the marker
  marker.scale.x = 0.826*2;
  marker.scale.y = 0.4265*2;
  marker.scale.z = 0.646*2;

  // Set the color of the marker
  marker.color.r = 0.0;
  marker.color.g = 1.0;
  marker.color.b = 0.5;
  marker.color.a = 1;

  // Set the lifetime of the marker
  marker.lifetime = ros::Duration();

  // Publish the marker
  while (ros::ok()) {
    marker_pub.publish(marker);
    ros::spinOnce();
  }

  return 0;
}